package com.people.whx.demo.controller;

import com.people.whx.demo.rocketmq.Message;
import com.people.whx.demo.rocketmq.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/rocketmq")
@RestController
public class RocketmqController {

    @Autowired
    private Producer producer;

    @RequestMapping("send")
    public String sendMessage(){
        Message message=new Message("message from sender","rocketmq");
        producer.sendMessage(message);
        return "fine";
    }
}
